home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0253.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  2.3 KB  |  73 lines

  1. On 13 Mar 1998, Jonas Thorell wrote:
  2.  
  3. > Garfield Benjamin (gbenjam@sosbbs.com) wrote:
  4. > >> If AGE<10
  5. > >>    Print "You are less than 10 years old."
  6. > >> else if AGE=21
  7. > >>    Print "Hey!! Now you can drink alcohol in the U.S.!!"
  8. > >> else
  9. > >>    Print "WOW, you're OVER 21!!"
  10. > >> endif
  11. > >> Smallest, and tidiest in my humble opinion.
  12. > >> Is my approach good enough in the meantime?
  13. > >   Well, problem is this won't work. 
  14. > Yes it will. I tried it.
  15. > >First, you need to match every If with an End If and second, the logic is not 
  16. > >the same.
  17. > Both. If and endif is coupled the same way as select ... case ... endselect
  18. > is so I can't see the problem. The logic is the same too. Select..is just
  19. > more advanced in that it offers some extra features.
  20. > >If AGE<10
  21. > >   Print "You are less than 10 years old."
  22. > >Else If AGE=21
  23. > >      Print"Hey!! Now you can drink alcohol in the U.S.!!"
  24. > >   Else If AGE>21
  25. > >         Print "WOW, you'r OVER 21!!"
  26. > >      End If
  27. > >   End If
  28. > >End If
  29. > That would trigger the error-system. One if and three end-ifs is plain
  30. > wrong.
  31. > >   That being said, this might be a bit clearer (arguably the "best"
  32. > >   method for AMOS) but it still lacks when compared to the
  33. > >   Select...Case style.  Anyway, the point is you are still looking at
  34. > >   the same two basic methods, the If...End If and the If...Else...EndIf
  35. > Yes but does it really matter? The result is what is importand and the
  36. > if...
  37. > else if ...
  38. > else
  39. > end if
  40. > structure is quite close to the select.. syntax.
  41. Hi, I just got to my email after a few weeks off and this is near the
  42. top of the bundle ... It's probably answered later on tho...
  43. Didn't one of the updates to Amos/Pro fix the Elseif etc prob? So
  44. although messy some older versions can only use the Second approach. I
  45. remember this change cos at the time I thought that Amos code
  46. sometimes looked ridiculous with all the indenting.....
  47.  
  48. ###       ###  ########  ########### ###########
  49. ####     #### ###    ###     ###         ###
  50. ##!##   ##!## #!#    #!#     #!#         #!#
  51. !#! #!#!# !@! !@!!@@!!@!     !@!         !@!     mattw@netsoc.ucd.ie
  52. !!!   !   !!! !!!    !!!     !!!         !!!            x  x
  53. :!:       :!: :!:    :!:     :!:         :!:            \__/
  54. :::       ::: :::    :::     :::         :::  
  55. ::         :: ::     ::       :           :
  56.  
  57.  
  58.